package com.swdegao.iot.netty.server.qianbaotonghandler;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.timeout.IdleStateHandler;

import java.util.concurrent.TimeUnit;

public class QianBaoTong_NettyServerChannelInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel socketChannel) {
    	socketChannel.pipeline().addLast(new IdleStateHandler(120,0,0, TimeUnit.SECONDS));
    	socketChannel.pipeline().addLast(new QianBaoTongDecoder());
        socketChannel.pipeline().addLast(new QianBaoTong_HeartBeatClientHandler());
        socketChannel.pipeline().addLast(new QianBaoTong_ParseMessgaeHandler());
        socketChannel.pipeline().addLast(new QianBaoTong_PushMessgaeHandler());
    }
}
